$(window).ready(function () {
  $('.timer').each(count);
  function count(options) {
    var $this = $(this);
    options = $.extend({}, options || {}, $this.data('countToOptions') || {});
    $this.countTo(options);
  }
  $(".math").removeClass("timer");
})
const intersectionObserver6 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  // 数字滚动脚本
  $('.timer').each(count);
  function count(options) {
    var $this = $(this);
    options = $.extend({}, options || {}, $this.data('countToOptions') || {});
    $this.countTo(options);
  }
  $(".math").removeClass("timer");
})
intersectionObserver6.observe(document.querySelector('.homt_five_div_class'))

const intersectionObserver = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { duration: 0.5, } })
  t1.from('.home_one_h1_class', { y: 300, ease: "power1.out", opacity: 0 })
  t1.from('.home_one_span_class', { y: 300, ease: "power1.out", opacity: 0 })
  t1.from('.home_one_btn_class', { y: 300, ease: "power1.out", opacity: 0 })
  t1.from('.home_one_div_class', { y: 300, ease: "power1.out", opacity: 0 })
  t1.from('.home_one_img_class', { y: 300, ease: "power1.out", opacity: 0 })
})
intersectionObserver.observe(document.querySelector('.home_one_h1_class'))

const intersectionObserver1 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { duration: 3, } })
  t1.from('.home_two_img_class', { opacity: 0 })
})
intersectionObserver1.observe(document.querySelector('.home_two_img_class'))

const intersectionObserver2 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { duration: 0.5, } })
  t1.from('.home_two_h5_class', { x: 200, ease: "power1.out", opacity: 0 })
  t1.from('.home_two_h1_class', { x: 200, ease: "power1.out", opacity: 0 })
  t1.from('.home_two_span_class', { x: 200, ease: "power1.out", opacity: 0 })
  t1.from('.home_two_div_class', { x: 200, ease: "power1.out", opacity: 0 })
  t1.from('.home_two_btn_class', { x: 200, ease: "power1.out", opacity: 0 })
})
intersectionObserver2.observe(document.querySelector('.home_two_h5_class'))

const intersectionObserver3 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { duration: 0.75, } })
  t1.from('.home_three_h6_class', { opacity: 0, })
  t1.from('.home_three_h1_class', { opacity: 0, })
})
intersectionObserver3.observe(document.querySelector('.home_three_h1_class'))

const intersectionObserver4 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { repeatDelay: 0.25 } })
  t1.from('.three_div1', { y: 300, ease: "power1.out", duration: 1, opacity: 0 })
  t1.from('.three_div2', { y: 300, ease: "power1.out", duration: 1, opacity: 0 })
  t1.from('.three_div3', { y: 300, ease: "power1.out", duration: 1, opacity: 0 })
  t1.from('.three_div4', { y: 300, ease: "power1.out", duration: 1, opacity: 0 })
})
intersectionObserver4.observe(document.querySelector('.home_three_div_class'))

let btnThisList = document.querySelectorAll('.three_div');
btnThisList.forEach(function (item) {
  //鼠标移入
  item.addEventListener('mouseover', function (event) {
    item.style.transform = 'scale(1.1)';
  })
  //鼠标移出
  item.addEventListener('mouseout', function (event) {
    item.style.transform = 'scale(1)';
  })
})

const intersectionObserver5 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { duration: 0.5 } })
  t1.from('.home_four_h6_class', { y: 300, ease: "power1.out", opacity: 0 })
})
intersectionObserver5.observe(document.querySelector('.home_four_class'))

const inter1 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { duration: 0.5 } })
  t1.from('.home_four_h1_class', { y: 300, ease: "power1.out", delay: 0.25, opacity: 0 })
})
inter1.observe(document.querySelector('.home_four_class'))
const inter2 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { duration: 0.5 } })
  t1.from('.home_four_span_class', { y: 300, ease: "power1.out", delay: 0.35, opacity: 0 })
})
inter2.observe(document.querySelector('.home_four_class'))

const inter3 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { repeatDelay: 0.75, duration: 0.5 } })
  t1.from('.home_four_div1_class', { y: 300, ease: "power1.out", delay: 0.5, opacity: 0 })
  t1.from('.home_four_div2_class', { y: 300, ease: "power1.out", opacity: 0 })
  t1.from('.home_four_div3_class', { y: 300, ease: "power1.out", opacity: 0 })
  t1.from('.home_four_div4_class', { y: 300, ease: "power1.out", opacity: 0 })
})
inter3.observe(document.querySelector('.home_four_class'))

const inter4 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { repeatDelay: 1, duration: 0.5 } })
  t1.from('.home_four_img_class', { opacity: 0 })
})
inter4.observe(document.querySelector('.home_four_class'))

const inter5 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { repeatDelay: 0.25 } })
  t1.from('.home_six_div1_class', { y: 300, ease: "power1.out", duration: 1, opacity: 0 })
  t1.from('.home_six_div2_class', { y: 300, ease: "power1.out", duration: 1, opacity: 0 })
  t1.from('.home_six_div3_class', { y: 300, ease: "power1.out", duration: 1, opacity: 0 })
  t1.from('.home_six_div4_class', { y: 300, ease: "power1.out", duration: 1, opacity: 0 })
})
inter5.observe(document.querySelector('.home_six_div_class'))

let btnThisList1 = document.querySelectorAll('.six_class');
btnThisList1.forEach(function (item) {
  //鼠标移入
  item.addEventListener('mouseover', function (event) {
    item.style.transform = 'scale(1.1)';
  })
  //鼠标移出
  item.addEventListener('mouseout', function (event) {
    item.style.transform = 'scale(1)';
  })
})

const inter7 = new IntersectionObserver(entries => {
  if (entries[0].intersectionRatio <= 0) return
  let t1 = gsap.timeline({ defaults: { duration: 1 } })
  t1.from('.home_seven_h1_class', { opacity: 0 })
})
inter7.observe(document.querySelector('.home_seven_h1_class'))